/*--------------------------------------------------------------------------------------*\
**
** adv_subterranean_gate.h
**
** Heroes IV
** Copyright 2000, The 3DO Company
**
\*--------------------------------------------------------------------------------------*/

#if !defined( ADV_SUBTERRANEAN_GATE_H_INCLUDED)
#define ADV_SUBTERRANEAN_GATE_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "adv_subterranean_gate_ptr.h"
#include "gateway_base.h"

// --------------------------------------------------------------------------
// t_adv_subterranean_gate class
// --------------------------------------------------------------------------

class t_adv_subterranean_gate : public t_gateway_base
{
public:
	// Constructor
	t_adv_subterranean_gate(  std::string const& source );
	virtual ~t_adv_subterranean_gate();

	virtual void    activate_trigger( t_army* army, t_adv_map_point const& point, 
		                              t_direction direction, t_adventure_frame* frame );
	static void     calculate_pairs( t_adventure_map * map ); 
	virtual	void	destroy();
	virtual int		get_version() const;
	virtual void	on_adventure_map_destruction();
	virtual void	pathing_destination_query( t_adventure_path_point const& source,
											   t_adventure_path_finder & path_finder ) const;
	virtual void	place( t_adventure_map &map, t_adv_map_point const&	point );
	virtual bool	read( std::streambuf&						stream, 
						  t_qualified_adv_object_type const&	type,
						  int									version );
	virtual void	read_postplacement( t_adventure_map& map );
	virtual bool	write( std::streambuf & stream ) const;

private:
	// Matching gate
	t_adv_subterranean_gate_ptr m_other_gate;

	t_adventure_global_id		m_other_gate_id; // Valid ONLY between read() and read_postplacement()

};

#endif // ADV_SUBTERRANEAN_H_INCLUDED

